Giora Simchoni, IBM Research
February 3rd, 2018
rstudio::conf 2018
This RPres/html is available at Github: https://github.com/gsimchoni/rstudio_conf_2018
But:
So:
survey packagelibrary(survey)
yrbss_data_binary <- svydesign(id = ~PSU, weight = ~weight, strata = ~stratum, data = yrbss_data_binary, nest = TRUE)
svyciprop(~I(qn63 == 1), subset(yrbss_data_binary, year == 2015), na.rm=TRUE)
devtools::install_github("gsimchoni/yrbss")
library(yrbss)
getProportionSingleVariable(.variable = "qn63", .location = "US", .year = 2015)
$prop
[1] 0.3009435
$ciLB
[1] 0.2728081
$ciUB
[1] 0.3306611
$n
[1] 13910
library(tidyverse)
tibble(.variable = rep("qn65", 26),
.location = rep("US", 26),
.year = rep(seq(1991, 2015, 2), 2),
.filters = rep(c("sex == 1", "sex == 2"),
each = 13)) %>%
bind_cols(
pmap_df(., getProportionSingleVariable)) %>%
ggplot(aes(.year, prop, color = .filters)) +
geom_line() +
scale_color_manual(
labels = c("Female", "Male"),
values = c("red", "blue")) +
labs(title = paste("YRBSS: Proportion of Male",
"and Female US Youth",
"Reporting Use of Condom"),
x = "Survey Year",
y = "Proportion Reporting Use of Condom",
color = "Gender")
library(kandinsky)
kandinsky(iris)
library(mocap)
#...
makeMotionMovie(asf, amc, xyz, skipNFrames = 4)
library(CastleOfR)
startGame()
library(songsim)
path <- system.file("extdata", "formation.txt",
package = "songsim")
songsim(path, colorfulMode = TRUE,
mainTitle = "Formation - Beyonce")
library(ssdkeras)
# it's complicated...
library(ebayr)
setEbayToken("YOUR_EBAY_TOKEN")
search_ebay("elvis costume")
library(ggwithimages)
#...
ggplot(kathmandu_hourly_aqi, aes(hour, aqi)) +
geom_line_with_image(annapurna, sky) +
labs(title = paste("Air Quality Index in the",
"Thamel, Kathmandu, Nepal"),
subtitle = paste("Measured in PM2.5",
"by the US Embassy",
"in Kathmandu"),
y = "Hourly Mean AQI [PM2.5]",
x = "Hour") +
ylim(c(50, 200)) +
theme(text = element_text(family="mono"),
axis.title.x = element_text(size=12),
axis.title.y = element_text(size=12))
Blog: http://giorasimchoni.com/
Github: https://github.com/gsimchoni
Twitter: https://twitter.com/GioraSimchoni
LinkedIn: https://www.linkedin.com/in/gsimchoni/
Thanks.